package com.foruo.learn.designmode.flyweight;

public class Goods implements IGoods {

    /** 商品类型 */
    private String type;
    /** 尺寸 */
    private String size;
    /** 价格 */
    private String price;

    public Goods(String type){
        this.type = type;
    }

    @Override
    public void sell() {
        // 这里输出了地址，由于判断对象有没有改变
        System.out.println(this.toString()+" -> Goods{" +
                "type='" + type + '\'' +
                ", size='" + size + '\'' +
                ", price='" + price + '\'' +
                '}');
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

}
